#include <iostream>
#include <ctime>
using namespace std;
const int N = 1e5 + 10;
int n;
int a[N];
int tmp[N];

void merge_sort(int left, int right)
{
    if(left >= right) return;

    int mid = (left + right) >> 1;

    // 递归排序左右区间
    merge_sort(left, mid);
    merge_sort(mid + 1, right);

    // 合并两个有序数组
    int cur1 = left, i = left, cur2 = mid + 1;

    while(cur1 <= mid && cur2 <= right)
    {
        if(a[cur1] <= a[cur2]) tmp[i++] = a[cur1++];
        else tmp[i++] = a[cur2++];
    }

    // 此时有一个数组已经排列完，将剩余一个数组加入
    while(cur1 <= mid) tmp[i++] = a[cur1++];
    while(cur2 <= right) tmp[i++] = a[cur2++];

    // 将辅助数组中的元素复制回原数组
    for(int i = left;i <= right;i++) a[i] = tmp[i];
}
int main()
{
    cin >> n;
    for(int i = 1;i <= n;i++) cin >> a[i];

    merge_sort(1, n);

    for(int i = 1;i <= n;i++) cout << a[i] << " ";
    return 0;
}